using com.youzu.warh.protocol;

public class TroopFightInfoPool : ProtoPoolBase<TroopFightInfo>
{
    protected override void RecycleChildren(TroopFightInfo data)
    {
        for (int i = 0; i < data.skills.Count; i++)
        {
            ProtoFactory.Recycle(data.skills[i]);
        }
        ProtoFactory.Recycle(data.coordinate);
        ProtoFactory.Recycle(data.troop);
        ProtoFactory.Recycle(data.soldiers);
        for (int i = 0; i < data.elements.Count; i++)
        {
            ProtoFactory.Recycle(data.elements[i]);
        }

        for (int i = 0; i < data.normalDamage.Count; i++)
        {
            ProtoFactory.Recycle(data.normalDamage[i]);
        }
        for (int i = 0; i < data.passiveDamage.Count; i++)
        {
            ProtoFactory.Recycle(data.passiveDamage[i]);
        }
    }

    protected override void ClearNetData(TroopFightInfo data)
    {
        data.troop = null;
        data.rage = 0;
        data.intSoldierNum = 0;
        data.curSoldierNum = 0;
        data.skills.Clear();
        data.soldiers.Clear();
        data.coordinate = null;
        data.elements.Clear();
        data.besiegePlayerId.Clear();
        data.besiege = 0;
        data.playerId = 0;
        data.speed = 0;
        data.isFightOver = false;
        data.normalDamage.Clear();
        data.passiveDamage.Clear();
        data.rageHeroIndex = 0;
        data.isAttackIntent = false;
    }
}